<div id="header">
	<div class="navbar navbar-fixed-top">
	  <div class="navbar-inner">
	    <div class="container">
	  
	      <a href="/" class="brand">西瓜社</a>
	      <div class="nav-collapse">
	        <ul class="nav">
	        	<%= web_nav params[:controller],params[:action]%>
	        </ul>
	      </div>

	      <form action="/search/topics"  method="get" class="navbar-search pull-left">
            <%= text_field_tag :query, params[:query], :class => "span3", :placeholder => " 搜索其实很简单... " %>
          </form>
			
		  <%if params[:controller] != 'home'%>	
          <div class="navbar-text pull-right nav nav-pills">
          	<% if current_logined? %>
          		<%= render 'public/notification', user: current_user %>
				
          		<a class="dropdown-toggle" data-toggle="dropdown" href="#menu-user">
				    <%= current_user.nickname %>
			    </a>
				<ul class="dropdown-menu">
					<li><%= link_to '个人主页',user_path(current_user) %></li>
					<li><%= link_to '个人标签',tags_user_path(current_user) %></li>
					<li><%= link_to '更新资料',edit_user_path(current_user) %></li>
					<% if current_user.is_admin? %>
					<li><%= link_to '后台管理', cpanel_groups_path %></li>
					<% end -%>
					<li><%= link_to '退出登录', quit_path %></li>
					
			    </ul>
			    <script type="text/javascript">
				$(function(){
					$('.dropdown-toggle').dropdown()
				})
				</script>
          	<% else %>
          	    <%= link_to '登录', login_path %>
          	  	<%= link_to '注册', reg_path %>
          	<%end%>

          </div>
		  <%end %>
			

	    </div>
	  </div>
	</div>
</div>